package com.zhangxin.aiInterview.manager.disruptor.strategy;

import com.zhangxin.aiInterview.manager.disruptor.WsEvent;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * ws发送消息策略执行器
 */
@Service
public class WsSendMsgExecutor {
    @Resource
    private LLmByAgentSendMsg llmByAgentSendMsg;
    @Resource
    private TTsByAgentSendMsg ttsByAgentSendMsg;

    public void doSend(WsEvent wsEvent){
        if (wsEvent.isTTs()){
            //tts 将ai面试官的问题转换为音频
            ttsByAgentSendMsg.sendMessage(wsEvent);
        }else {
            //ai面试官生成问题
            llmByAgentSendMsg.sendMessage(wsEvent);
        }
    }
}